layui.use('form', function () {
    var form = layui.form();
    form.render();
});

form.on('radio(distribution)', function(data){
    $.ajax({
        url:"/admin/distribution/updateDistributeType",
        type:"post",
        data:{type:data.value},
        success:function(res){
            console.log(res);
            if(res.status == 1){
                layer.msg('分配成功',{time:2000},function(){
                    window.location.reload();
                })
            }else{
                layer.msg('请勿重复操作')
            }
        }
    });
  });  